<?php
/**
 * @author CptSoap
 * @email 694652150@qq.com
 * @date 2021/10/4
 * 生成uuid
 */

namespace app\admin\utils;

class uuidUtils
{
    static function getUUID(): string
    {
        $chars = md5(uniqid(mt_rand(), true));
        return substr($chars, 0, 8) . '-'
            . substr($chars, 8, 4) . '-'
            . substr($chars, 12, 4) . '-'
            . substr($chars, 16, 4) . '-'
            . substr($chars, 20, 12);
    }
}